<tr>
 <th>存货计价法：</th>
 <td>
	<select name="extends_set[stockcost_cost]" id="stockcost_cost" <{if $stockcost_cost}>disabled="disabled"<{/if}>>
	<option value="1" <{if $stockcost_cost == '1'}>selected="selected"<{/if}> >不计成本</option>
	<option value="2" <{if $stockcost_cost == '2'}>selected="selected"<{/if}> >固定成本法</option>
	<option value="3" <{if $stockcost_cost == '3'}>selected="selected"<{/if}> >平均成本法</option>
	<option value="4" <{if $stockcost_cost == '4'}>selected="selected"<{/if}> >先进先出法</option>
	</select>
</td>
 </tr>
 <tr>
 <th>盘点/调账成本取值：</th>
 <td><table>
					<tr><td><input type="radio" <{if $stockcost_get_value_type == '1'}>checked="checked"<{/if}> <{if $stockcost_get_value_type}>disabled="disabled"<{/if}> name="extends_set[stockcost_get_value_type]" value="1">取货品的固定成本</td></tr>
					<tr><td><input type="radio" <{if $stockcost_get_value_type == '2'}>checked="checked"<{/if}> <{if $stockcost_get_value_type}>disabled="disabled"<{/if}>  name="extends_set[stockcost_get_value_type]" value="2">取货品的单位平均成本</td></tr>
					<tr><td><input type="radio" <{if $stockcost_get_value_type == '3'}>checked="checked"<{/if}> <{if $stockcost_get_value_type}>disabled="disabled"<{/if}>  name="extends_set[stockcost_get_value_type]" value="3">取货品的最近一次出入库成本</td></tr>
					<tr><td><input type="radio" <{if $stockcost_get_value_type == '4'}>checked="checked"<{/if}> <{if $stockcost_get_value_type}>disabled="disabled"<{/if}>  name="extends_set[stockcost_get_value_type]" value="4">取0</td></tr>
			</table>
</td>
	<td id ="sure_div" style="display:none">
		<table><tr><th>存货计价法：</th><td><span>A</span></td></tr><tr><th>盘点/调账成本取值：</th><td><li>B</li></td></tr><tr><th></td><td>系统将取货品固定成本为期初单位成本,由此计算所有期初数值</td></tr>
		<tr><th></th><td style="color:red;font-size:13px;">请确认以上设定，一经提交不可修改</td></tr>
		<tr><td>            <{button label="确认" type="button" name="con"  onclick="submit_setting(this);"}></td><td><{button label="取消" type="button" name="can" onclick="cancle_setting(this);" }></td></tr>
		</table>
	</td>
<{if !$stockcost_cost || !$stockcost_get_value_type}>
<script>
		var  btn = $("btn-setting");
		var _form = $("form-setting");
		btn.addEvent('click',function(e){
		var a;
		var l = $$("input[name='extends_set[stockcost_get_value_type]']");
		for(i=0;i<l.length;i++)  
		{  
			if(l[i].checked)  a=l[i].getParent('tr').get('text'); 
		}
		if(!a){MessageBox.error('请选择盘点/调账成本取值');return false;}
		e.stop();
		var  new_div =$('sure_div').clone();
				new_div.setStyle("display","inline");
				new_div.getElement("span").innerHTML=$('stockcost_cost').options[$('stockcost_cost').selectedIndex].text;
				new_div.getElement("li").innerHTML=a;
							var dialog =new Dialog(new_div,{
								width:350,title:'系统设置',modal:true});
								return ;
		
		});

	function submit_setting(t)
	{
		var  btn = $("btn-setting");
		var _form = $("form-setting");
		var _dialogIns = t.getParent('.dialog').retrieve('instance');
		if(_dialogIns)
				{
					_dialogIns.close();
				}
		 _form.fireEvent('submit',{stop:$empty});
	}

	function cancle_setting(t)
	{
		var  btn = $("btn-setting");
		var _dialogIns = t.getParent('.dialog').retrieve('instance');
		if(_dialogIns)
				{
					_dialogIns.close();
				}
	}
</script>
<{/if}>